<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title>06监听属性</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>

<body>
    <div id="demo">
        <h1>今天天气很{{info}}</h1>
        <button @click="isHot = !isHot">切换天气</button>
    </div>
    <script type="text/javascript">
        Vue.config.productionTip = false
        new Vue({
            el: '#demo',
            data: {
                isHot : true,
            },
            methods: {},
            computed: {
                info(){
                    return this.isHot?"炎热":"凉爽"
                }
            }
        })
    </script>
</body>

</html>